const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");

module.exports = {
  mode: "development",
  // development devtool: 'cheap-module-eval-source-map',
  // production devtool: 'cheap-module-source-map',
  devtool: "cheap-module-eval-source-map",
  entry: {
    main: "./webpack03-sourcemap/src/index.js"
  },
  module: {
    rules: []
  },
  plugins: [
    new CleanWebpackPlugin(),
    new HtmlWebpackPlugin({
      template: "webpack03-sourcemap/src/template.html"
    })
  ],
  output: {
    filename: "[name].js",
    path: path.resolve(__dirname, "dist")
  }
};
